import java.util.Scanner;
import java.util.InputMismatchException;
//import java.lang.RuntimeException;
import java.lang.Exception;
public class myClass {
    public static void main(String[] agrs) //throws checkPositiveInt, Exception
    {
        Scanner t=new Scanner(System.in);
        int a;
        try{
            System.out.print("a= ");
            a=t.nextInt();
            if(a<0) throw new checkPositiveInt("input must be positive integer");
        }catch(InputMismatchException e)
        {
            System.out.println("Invalid input");
        }catch(checkPositiveInt ex){
            System.out.print("input must be positive integer");
        }
    }
}
 class checkPositiveInt extends Exception{
   public  checkPositiveInt(String a){
        System.out.println(a);
    }
}
